import { deletedJson, get, postJSON, putJSON } from '@/utils/request'
// 合并购物车
export const memberCartMerge = (mergeCartList) => {
  return postJSON('/member/cart/merge', mergeCartList)
}

// 获取-购物车列表
export const getMemberCartList = () => {
  return get('/member/cart')
}

// 加入购物车
export const addMemberCart = (skuId, count) => {
  return postJSON('/member/cart', { skuId, count })
}

// 删除购物车
export const delMemberCart = (ids) => {
  return deletedJson('/member/cart', {ids:ids})
}

//修改购物车
export const selectedCartId = (id, selected, count) => {
  return putJSON(`/member/cart/${id}`, { selected, count })
}

//修改-购物车全选/取消
export const selectedCartIds = (ids, selected) => {
  return putJSON(`/member/cart/selected`, { selected, ids })
}

